﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DevicesInt
{
    public class DevicesInt
    {
    }

    public class DeviceStatusRecord
    {
        public string Severity { get; set; }
        public string Name { get; set; }
        public string Source { get; set; }
        public string Details { get; set; }

        public override string ToString()
        {
            var st = new StringBuilder();
            st.Append(Severity + ":");
            if (string.IsNullOrEmpty(Source))
                st.Append(Source + " - ");
            if (string.IsNullOrEmpty(Details))
                st.Append(Name + ";");
            else
            {
                st.Append(Name + ". ");
                st.Append(Details + ";");
            }
            
            return st.ToString();
        }
    }

    // ReSharper disable InconsistentNaming
    public struct Severity
    {
        public const string ALARM = "Alarm";
        public const string CLEARED = "Cleared";
        public const string INDETERMINATE = "Indeterminate";
        public const string WARNING = "Warning";
        public const string MINOR = "Minor";
        public const string MAJOR = "Major";
        public const string CRITICAL = "Critical";

    }

    public struct Errors
    {
        public const string ERR_BEG = "err:";
        public const string NO_CONNECTION_OID = ".1.3";
        public const string NO_CONNECTION = "no_cnnctn";
        public const string WRONG_INPUT_DATA = "wrong_input_data:";
        public const string LENGTH = "length";
        public const string ARGUMENTS_COUNT = "arguments_count";
        public const string NOT_IMPLEMENTED = "not_implemented";
        public const string NO_ERRORS = "ok";
    }

    public struct ReadableErrors
    {
        public const string NO_CONNECTION = "Нет связи с устройством";
    }

    public struct Messages
    {
        public const string NOTHING_HERE = "nthng_t_d_hr";
    }
    // ReSharper restore InconsistentNaming

}
